
#include "Httpservice.hpp"
#include <memory>

void HttpRequstservice(int socket)
{
    char buff[10240];
    MySocket sock;
    ssize_t num = sock.Recv(socket, buff, sizeof buff - 1);
    if (num > 0 )
    {
        buff[num] = 0;
        std::cout << buff  << std::endl << "-------------------------play" << std::endl; 
    }
}

int main(int argc, char* args[0])
{
    if (argc != 2)
    {
        [args]{printf("%s需要port\n", args[0]);}();
        exit(0);
    }
 
    std::unique_ptr<Httpserver> it(new Httpserver(atoi(args[1]), HttpRequstservice));
    it->Stat();

    return 0;
}




